﻿using HSDc.RingleFlow.Api;
using HSDc.RingleFlow.Api.Factory;
using HSDc.RingleFlow.Api.Service;
using HSDc.RingleFlow.Kernel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace RingleFlow.Web.Controllers
{
    public class RepositoryController : Controller
    {
        [HttpPost]
        public JsonResult Index(string definitionXml)
        {
            IWorkflowEngine engine = WorkflowEngineFactory.GetInstance();
            IRepositoryService service = engine.RespositoryService;
            string decodeXml = Server.UrlDecode(definitionXml);
            return Json(service.RegisterProcessDefinition(decodeXml));
        }

    }
}
